;
layui.define([ "table", "form" ], function(exports) {
    tab = layui.table, form = layui.form;
    tab.render({
        elem : "#LAY-web-list",
        url : layui.setter.base + "admin/hetong/listJson",
        cols : [ [ {
            field : "title",
            width : 160,
            title : "合同名称",
            sort : !0
        }, {
            field : "signKeyword",
            title : "合同关键字"
        }, {
            field : "filename",
            title : "合同文件名"
        }, {
            field : "enable",
            title : "状态",
            width : 60,
            templet : function(data){return data.enable?"启用":"禁用"}
        }, {
            field : "updateTime",
            title : "上传时间"
        }, {
            title : "操作",
            width : 180,
            align : "center",
            fixed : "right",
            toolbar : "#table-content-list"
        } ] ],
        page : !0,
        limit : 10,
        limits : [ 10, 15, 20, 25, 30 ],
        text: {none: '暂无相关数据'}
    }), tab.on("tool(LAY-web-list)", function(row) {
        if ("update" === row.event) {
            layui.admin.req({
                url : layui.setter.base + "admin/hetong/updatePage?id="
                    + row.data.id + "&r=" + Math.random(),
                data : null,
                done : function(res) {
                    if (res.code !== 0) {
                        layer.msg(res.msg, {
                            icon : 2
                        });
                    } else {
                        layer.msg(res.msg, {
                            icon : 1
                        });
                        layui.table.reload('LAY-web-list'); // 重载表格
                    }
                }
            });

            return;
        }

        if ("look" === row.event) {
            //window.location.href=
               window.open(layui.setter.base + "admin/hetong/look?id="
                + row.data.id + "&r=" + Math.random());
        }
    }), exports("hetong", {})
});
